import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import store from './store'
// @ts-ignore
import mavonEditor from 'mavon-editor';
import  * as Icons from '@ant-design/icons-vue';
import locale from "element-plus/es/locale/lang/zh-cn";
import 'mavon-editor/dist/css/index.css'
// @ts-ignore
import jsonpath from "jsonpath";
// @ts-ignore
import {commonParamChange, getCommonParamObj} from "./utils/commonParamUtil.js";
// @ts-ignore
import request from "./utils/request.js";
import {ElNotification} from 'element-plus'
// 导入低码的全局组件
// @ts-ignore
import ButtonComponent from "./components/lowcode/common/components/ButtonComponent";
// @ts-ignore
import ButtonDrawer from "./components/lowcode/common/drawer/ButtonDrawer";
// @ts-ignore
import SpanComponent from "./components/lowcode/common/components/SpanComponent";
// @ts-ignore
import SpanDrawer from "./components/lowcode/common/drawer/SpanDrawer";
// @ts-ignore
import TabsComponent from "./components/lowcode/common/components/TabsComponent";
// @ts-ignore
import TabsDrawer from "./components/lowcode/common/drawer/TabsDrawer";
// @ts-ignore
import AlertMessageComponent from "./components/lowcode/common/components/AlertMessageComponent";
// @ts-ignore
import AlertMessageDrawer from "./components/lowcode/common/drawer/AlertMessageDrawer";
// @ts-ignore
import PercentageComponent from "./components/lowcode/common/components/PercentageComponent.vue";
// @ts-ignore
import PercentageDrawer from "./components/lowcode/common/drawer/PercentageDrawer.vue";
// @ts-ignore
import InputComponent from "./components/lowcode/form/components/InputComponent.vue";
// @ts-ignore
import InputDrawer from "./components/lowcode/form/drawer/InputDrawer.vue";
// @ts-ignore
import InputNumberComponent from "./components/lowcode/form/components/InputNumberComponent.vue";
// @ts-ignore
import InputNumberDrawer from "./components/lowcode/form/drawer/InputNumberDrawer.vue";
// @ts-ignore
import DateComponent from "./components/lowcode/form/components/DateComponent.vue";
// @ts-ignore
import DateDrawer from "./components/lowcode/form/drawer/DateDrawer.vue";
// @ts-ignore
import TableComponent from "./components/lowcode/common/components/TableComponent";
// @ts-ignore
import TableDrawer from "./components/lowcode/common/drawer/TableDrawer";
// @ts-ignore
import PaginationComponent from "./components/lowcode/common/components/PaginationComponent";
// @ts-ignore
import PaginationDrawer from "./components/lowcode/common/drawer/PaginationDrawer";
// @ts-ignore
import LayOutComponent from "./components/lowcode/layout/components/LayOutComponent";
// @ts-ignore
import LayOutDrawer from "./components/lowcode/layout/drawer/LayOutDrawer";
// @ts-ignore
import GlobalFormComponent from "./components/lowcode/form/components/GlobalFormComponent";
// @ts-ignore
import GlobalFormDrawer from "./components/lowcode/form/drawer/GlobalFormDrawer";
// @ts-ignore
import DialogComponent from "./components/lowcode/feedBack/components/DialogComponent";
// @ts-ignore
import DialogComponentDrawer from "./components/lowcode/feedBack/drawer/DialogComponentDrawer";
// @ts-ignore
import DrawerComponent from "./components/lowcode/feedBack/components/DrawerComponent";
// @ts-ignore
import DrawerComponentDrawer from "./components/lowcode/feedBack/drawer/DrawerComponentDrawer";
// @ts-ignore
import SelectComponent from "./components/lowcode/form/components/SelectComponent.vue";
// @ts-ignore
import SelectDrawer from "./components/lowcode/form/drawer/SelectDrawer.vue";
// @ts-ignore
import TableSelectionSearchComponent from "./components/lowcode/extension/components/TableSelectionSearchComponent.vue";
// @ts-ignore
import TableSelectionSearchDrawer from "./components/lowcode/extension/drawer/TableSelectionSearchDrawer.vue";
// @ts-ignore
import MarkDownComponent from "./components/lowcode/extension/components/MarkDownComponent.vue";
// @ts-ignore
import MarkDownDrawer from "./components/lowcode/extension/drawer/MarkDownDrawer.vue";
// @ts-ignore
import MarkDownDirectoryComponent from "./components/lowcode/extension/components/MarkDownDirectoryComponent.vue";
// @ts-ignore
import MarkDownDirectoryDrawer from "./components/lowcode/extension/drawer/MarkDownDirectoryDrawer.vue";
// @ts-ignore
import MenuListComponent from "./components/lowcode/extension/components/MenuListComponent.vue";
// @ts-ignore
import MenuListDrawer from "./components/lowcode/extension/drawer/MenuListDrawer.vue";
// @ts-ignore
import EditableTableListComponent from "./components/lowcode/extension/components/EditableTableListComponent.vue";
// @ts-ignore
import EditableTableListDrawer from "./components/lowcode/extension/drawer/EditableTableListDrawer.vue";
// @ts-ignore
import CommonCardComponent from "./components/lowcode/card/components/CommonCardComponent"
// @ts-ignore
import CommonCardDrawer from "./components/lowcode/card/drawer/CommonCardDrawer"
// @ts-ignore
import CardListComponent from "./components/lowcode/card/components/CardListComponent"
// @ts-ignore
import CardListDrawer from "./components/lowcode/card/drawer/CardListDrawer"
// @ts-ignore
import MenuComponent from "./components/lowcode/navigation/components/MenuComponent"
// @ts-ignore
import MenuDrawer from "./components/lowcode/navigation/drawer/MenuDrawer"
// @ts-ignore
import AffixComponent from "./components/lowcode/navigation/components/AffixComponent"
// @ts-ignore
import AffixDrawer from "./components/lowcode/navigation/drawer/AffixDrawer"
// @ts-ignore
import MenuDropDownComponent from "./components/lowcode/navigation/components/MenuDropDownComponent"
// @ts-ignore
import MenuDropDownDrawer from "./components/lowcode/navigation/drawer/MenuDropDownDrawer"
// @ts-ignore
import BreadCrumbComponent from "./components/lowcode/navigation/components/BreadCrumbComponent"
// @ts-ignore
import BreadCrumbDrawer from "./components/lowcode/navigation/drawer/BreadCrumbDrawer"
// @ts-ignore
import VueRouterComponent from "./components/lowcode/special/components/VueRouterComponent.vue"
// @ts-ignore
import VueRouterDrawer from "./components/lowcode/special/drawer/VueRouterDrawer.vue"
// @ts-ignore
import VueComponentComponent from "./components/lowcode/special/components/VueComponentComponent.vue"
// @ts-ignore
import VueComponentDrawer from "./components/lowcode/special/drawer/VueComponentDrawer.vue"
// @ts-ignore
import FileUploadComponent from "./components/lowcode/file/components/FileUploadComponent.vue"
// @ts-ignore
import FileUploadDrawer from "./components/lowcode/file/drawer/FileUploadDrawer.vue"
// @ts-ignore
import ImageComponent from "./components/lowcode/file/components/ImageComponent.vue"
// @ts-ignore
import ImageDrawer from "./components/lowcode/file/drawer/ImageDrawer.vue"
// @ts-ignore
import FileUploadMultiComponent from "./components/lowcode/file/components/FileUploadMultiComponent.vue"
// @ts-ignore
import FileUploadMultiDrawer from "./components/lowcode/file/drawer/FileUploadMultiDrawer.vue"
// @ts-ignore
import LineChartComponent from "./components/lowcode/echarts/components/LineChartComponent"
// @ts-ignore
import LineChartComponentDrawer from "./components/lowcode/echarts/drawer/LineChartComponentDrawer"
// @ts-ignore
import YwuStartNode from "./views/bpmn/flow/node/YwuStartNode.vue"
// @ts-ignore
import YwuEndNode from "./views/bpmn/flow/node/YwuEndNode.vue"
// @ts-ignore
import YwuExecutorNode from "./views/bpmn/flow/node/YwuExecutorNode.vue"
// @ts-ignore
import YwuServiceNode from "./views/bpmn/flow/node/YwuServiceNode.vue"
// @ts-ignore
import YwuConditionalNode from "./views/bpmn/flow/node/YwuConditionalNode.vue"
// @ts-ignore
import YwuParallelNode from "./views/bpmn/flow/node/YwuParallelNode.vue"
// @ts-ignore
import YwuApprovalNode from "./views/bpmn/flow/node/YwuApprovalNode.vue"
// @ts-ignore
import YwuFormInput from "./views/bpmn/form/component/YwuFormInput.vue"


let app = createApp(App).use(store).use(router).use(ElementPlus, {locale}).use(mavonEditor);

// 挂载现有的全局组件
app.component("ButtonComponent", ButtonComponent);
app.component("ButtonDrawer", ButtonDrawer);
app.component("SpanComponent", SpanComponent);
app.component("SpanDrawer", SpanDrawer);
app.component("TabsComponent", TabsComponent);
app.component("TabsDrawer", TabsDrawer);
app.component("AlertMessageComponent", AlertMessageComponent);
app.component("AlertMessageDrawer", AlertMessageDrawer);
app.component("InputComponent", InputComponent);
app.component("InputDrawer", InputDrawer);
app.component("InputNumberComponent", InputNumberComponent);
app.component("InputNumberDrawer", InputNumberDrawer);
app.component("PercentageComponent", PercentageComponent);
app.component("PercentageDrawer", PercentageDrawer);
app.component("TableComponent", TableComponent);
app.component("TableDrawer", TableDrawer);
app.component("PaginationComponent", PaginationComponent);
app.component("PaginationDrawer", PaginationDrawer);
app.component("LayOutComponent", LayOutComponent);
app.component("LayOutDrawer", LayOutDrawer);
app.component("GlobalFormComponent", GlobalFormComponent);
app.component("GlobalFormDrawer", GlobalFormDrawer);
app.component("DialogComponent", DialogComponent);
app.component("DialogComponentDrawer", DialogComponentDrawer);
app.component("DrawerComponent", DrawerComponent);
app.component("DrawerComponentDrawer", DrawerComponentDrawer);
app.component("SelectComponent", SelectComponent);
app.component("SelectDrawer", SelectDrawer);
app.component("TableSelectionSearchComponent", TableSelectionSearchComponent);
app.component("TableSelectionSearchDrawer", TableSelectionSearchDrawer);
app.component("MarkDownComponent", MarkDownComponent);
app.component("MarkDownDrawer", MarkDownDrawer);
app.component("MarkDownDirectoryComponent", MarkDownDirectoryComponent);
app.component("MarkDownDirectoryDrawer", MarkDownDirectoryDrawer);
app.component("MenuListComponent", MenuListComponent);
app.component("MenuListDrawer", MenuListDrawer);
app.component("EditableTableListComponent", EditableTableListComponent);
app.component("EditableTableListDrawer", EditableTableListDrawer);
app.component("CommonCardComponent", CommonCardComponent);
app.component("CommonCardDrawer", CommonCardDrawer);
app.component("CardListComponent", CardListComponent);
app.component("CardListDrawer", CardListDrawer);
app.component("MenuComponent", MenuComponent);
app.component("MenuDrawer", MenuDrawer);
app.component("MenuDropDownComponent", MenuDropDownComponent);
app.component("MenuDropDownDrawer", MenuDropDownDrawer);
app.component("AffixComponent", AffixComponent);
app.component("AffixDrawer", AffixDrawer);
app.component("BreadCrumbComponent", BreadCrumbComponent);
app.component("BreadCrumbDrawer", BreadCrumbDrawer);
app.component("VueRouterComponent", VueRouterComponent);
app.component("VueRouterDrawer", VueRouterDrawer);
app.component("VueComponentComponent", VueComponentComponent);
app.component("VueComponentDrawer", VueComponentDrawer);
app.component("FileUploadComponent", FileUploadComponent);
app.component("FileUploadDrawer", FileUploadDrawer);
app.component("ImageComponent", ImageComponent);
app.component("ImageDrawer", ImageDrawer);
app.component("FileUploadMultiComponent", FileUploadMultiComponent);
app.component("FileUploadMultiDrawer", FileUploadMultiDrawer);
app.component("LineChartComponent", LineChartComponent);
app.component("LineChartComponentDrawer", LineChartComponentDrawer);
app.component("DateComponent", DateComponent);
app.component("DateDrawer", DateDrawer);

app.component("YwuStartNode", YwuStartNode);
app.component("YwuEndNode", YwuEndNode);
app.component("YwuExecutorNode", YwuExecutorNode);
app.component("YwuServiceNode", YwuServiceNode);
app.component("YwuConditionalNode", YwuConditionalNode);
app.component("YwuParallelNode", YwuParallelNode);
app.component("YwuApprovalNode", YwuApprovalNode);
app.component("YwuFormInput", YwuFormInput);

app.config.globalProperties.$commonParamChange = commonParamChange;
app.config.globalProperties.$getCommonParamObj = getCommonParamObj;
app.config.globalProperties.$request = request;
app.config.globalProperties.$ElNotification = ElNotification;
app.config.globalProperties.$window = window;
app.config.globalProperties.$jsonpath = jsonpath;

Object.keys(Icons).forEach((key)=>{
    app.component(key, Icons[key as keyof typeof Icons])
})
// 将对象存入vuex
store.commit('changeApp', app);
// 挂载全局app
app.mount(`#app`)
